try:
    cdm.parse_license(session_id, licence)
except Exception as e:
    js.document.getElementById('result').value=f"Impossible de déchiffrer !\n\nRéponse de licence :\n{licence}"
    js.document.getElementById('result').style.color = "red"
    raise Exception(e)

# get keys
keys=""
for key in cdm.get_keys(session_id):
    if key.type=="CONTENT":
        #keys+=f"{key.kid.hex}:{key.key.hex()}\n"
        keys+=f"--key {key.kid.hex}:{key.key.hex()} "

# close session, disposes of session data
cdm.close(session_id)
keys
